home *** CD-ROM | disk | FTP | other *** search
Text File | 1987-01-06 | 6.4 KB | 275 lines | [TEXT/EDIT] |
- // OSIO.h
- // Mac OS I/O interface
- // © Copyright 1984 Consulair Corp, All Rights Reserved.
- // Portions © Copyright Apple Computer, Inc: 1982, 1983, 1984
- // Stanford University, SUMEX project: 1984
- // Generally use HFSdefs.h since it supports both
- // the MFS and HFS file managers and file systems.
-
- #ifndef OSioLoaded
-
- #ifndef MacdefsLoaded
- #include "macdefs.h"
- #endif
-
- #define OSioLoaded
-
- #ifdef HFSdefsLoaded
- #Options E
- ####You cannot include OSIO.h and HFSDefs.h in the same file####
- #endif
-
- // file system error codes
-
- #define dirFulErr -33
- #define dskFulErr -34
- #define nsvErr -35
- #define ioErr -36
- #define bdNamErr -37
- #define fnOpnErr -38
- #define eofErr -39
- #define posErr -40
- #define mFulErr -41
- #define tmfoErr -42
- #define fnfErr -43
- #define wPrErr -44
- #define fLckdErr -45
- #define vLckdErr -46
- #define fBsyErr -47
- #define dupFNErr -48
- #define opWrErr -49
- #define paramErr -50
- #define rfNumErr -51
- #define GFPErr -52
- #define volOffLinErr -53
- #define permErr -54
- #define volOnLinErr -55
- #define nsDrvErr -56
- #define noMacDskErr -57
- #define extFSErr -58
- #define fsRnErr -59
- #define badMDBErr -60
- #define wrPermErr -61
- #define firstDskErr -84
- #define lastDskErr -64
-
- // IO queue elements
-
- #define OsType long
- struct FInfo
- { // FInfo, finder info
- OsType fdType;
- OsType fdCreator;
- short fdFlags;
- Point fdLocation;
- short fdFldr;
- };
-
- #define FInfo struct FInfo
-
- // Finder attributes
- #define cfInited 0x0100
- #define cfHasChanged 0x0200
- #define cfIsBusy 0x0400
- #define cfNoCopy 0x0800
- #define cfSystemFile 0x1000
- #define cfHasBundle 0x2000
- #define cfInvisible 0x4000
- #define cfLocked 0x8000
-
- // Finder flags
- #define fTrash -3
- #define fDeskTop -2
- #define fDisk 0
-
-
- // File System attributes
- #define fsLocked 0x01
- #define fsNoCopy 0x40
- #define fsBusy 0x80
-
-
- // read/write permissions
- #define fsCurPerm 0
- #define fsRdPerm 1
- #define fsWrPerm 2
- #define fsRdWrPerm 3
-
- // ioPosMode settings
- #define fsAtMark 0 /* from current - ignore ioPosOffset */
- #define fsFromStart 1 /* offset from beginning of file */
- #define fsFromLEOF 2 /* offset from logical end-of-file */
- #define fsFromMark 3 /* offset from current mark */
-
- struct __IO
- { // general IO parameter block
- struct __IO *ioLink;
- short ioType;
- short ioTrap;
- Ptr ioCmdAddr;
- ProcPtr ioCompletion;
- short ioResult;
- char *ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- char ioVersNum;
- char ioPermssn;
- Ptr ioMisc;
- // Rename: new name
- // GetEOF,SetEOF: logical end of file
- // Open: optional ptr to buffer
- // SetFileType: new type
- Ptr ioBuffer;
- long ioReqCount;
- long ioActCount;
- short ioPosMode;
- long ioPosOffset;
- };
-
- #define ioParam struct __IO
- typedef struct __IO IOParam;
-
- struct __FP
- { // get/set fileinfo parameter block
- struct __FP *ioLink;
- short ioType;
- short ioTrap;
- Ptr ioCmdAddr;
- ProcPtr ioCompletion;
- short ioResult;
- char *ioNamePtr;
- short ioVRefNum;
- short ioFRefNum;
- char ioFVersNum;
- char filler1;
- short ioFDirIndex;
- char ioFlAttrib; // in-use bin=7 lock bit=0
- char ioFlVersNum;
- FInfo ioFlFndrInfo;
- long ioFlNum;
- short ioFlStBlk;
- long ioFlLgLen;
- long ioFlPyLen;
- short ioFlRStBlk;
- long ioFlRLgLen;
- long ioFlRPyLen;
- long ioFlCrDat;
- long ioFlMdDat;
- };
-
- #define FileParam struct __FP
-
- struct __VP
- { // get/set volumeinfo parameter block
- struct __VP *ioLink;
- short ioType;
- short ioTrap;
- Ptr ioCmdAddr;
- ProcPtr ioCompletion;
- short ioResult;
- char *ioNamePtr;
- short ioVRefNum;
- long filler2;
- short ioVolIndex;
- long ioVCrDate;
- long ioVLsBkUp;
- short ioVAtrb;
- short ioVNmFls;
- short ioVDirSt;
- short ioVBlLn;
- short ioVNmAlBlks;
- long ioVAlBLkSiz;
- long ioVClpSiz;
- short ioAlBlSt;
- long ioVNxtFNum;
- short ioVFrBlk;
- };
-
- #define VolumeParam struct __VP
-
- // parameters for control (CC) and status (SC) calls
- // maximum variant size is 22 bytes
-
- union __OP
- {
- // maximum variant size
- char filler[22];
-
- //for sound generator
- short sndVal;
-
- //for asynchronous driver
- short asncConfig; // CC=8, stopbits, etc.
- struct
- { // CC=9
- Ptr asncBPtr; // new input buffer
- short asncBLen; // buffer length
- } asyncInBuff;
- struct
- { // CC=10
- char fXOn; // XON flow ctl enabled
- char fCTS; // CTS flow ctl enabled
- char xon; // xon char
- char xoff; // xoff char
- char errs; // errors mask
- char evts; // event mask
- char fInX; // input xon enabled
- char filler4;
- } asyncShk;
- long asyncNBytes; // SC=2, # buffered bytes
- struct
- { // SC=8, status info
- char cumerrs; // cum errors
- char XOffSend; // xoff has been sent
- char rdpend; // read pending
- char wrpend; // write pending
- char CTSHold; // CTS flow hold
- char XOFFHold; // Xoff flow hold
- } ASStaRec;
-
- //for printer driver
- struct
- { // CC=4, printing bitmap
- long param1; // pnts to quickdraw bitmap
- long param2; // pnts to rect within bitmap
- long param3; // 0 for screen printing
- } printer;
- // CC=5 writing raw to printer
- // pointer to a byte string
- // count of bytes
- // pointer to an idle proc (or NIL)
- // CC=6 special BitMap cases
- // screen or top folder code
-
- // for font manager
- struct
- { // CC=8, tail hook
- Ptr fontRecPtr; // font mgr input record
- short fontCurDev; // current device
- } fontMgr;
-
- // for io driver/desk accessory
- Ptr event; // pointer to EventRecord
- }; // end union of control status params
-
- #define OpParamType union __OP
-
- struct __CP
- { // control and status parameter block
- struct __CP *ioLink;
- short ioType;
- short ioTrap;
- Ptr ioCmdAddr;
- ProcPtr ioCompletion;
- short ioResult;
- char *ioNamePtr;
- short ioVRefNum;
- short ioRefNum;
- short CSCode;
- OpParamType csp;
- };
-
- #define CntrlParam struct __CP
-
- #endif
-